package com.gp.node;

import com.stock.StockData;

// this class represent IValue nodes that contains closing price in their value 
// override functions description can be found at the interface IValue
public class ClosingPrice extends IValue {
	
	private static final long serialVersionUID = -6728465077622655589L;

	@Override
	public double getValue(StockData stock) {
		return stock.getClosingPrice();
	}
	
	@Override
	public INode createNew()  {
		return new ClosingPrice();
	}

	@Override
	public INode copy() {
		return new ClosingPrice();
	}
	
	@Override
	public String print(StockData stock) {
		return String.valueOf(stock.getClosingPrice());
	}
	
	@Override
	public String print() {
		return " ClosingPrice ";
	}

}
